import {reactive} from "vue";
import type {Goods} from "@/types/goods";
import type {Category} from "@/types/categories";
import type {Slides} from "@/types/slides";

const state = reactive<{
    categories?: Category.Dto[];
    goods?: Goods.Content;
    slides?:Slides.Dto[];
}>({
    categories: [],
    goods: {},
    slides:[],
});

const goodsState = reactive(<{
    sales:{list:Goods.Dto[], page:number};
    news:{list:Goods.Dto[], page:number};
    recommend:{list:Goods.Dto[], page:number};
    currentType:string;
}>({
    sales:{list:[], page:1},
    news:{list:[], page:1},
    recommend:{list:[], page:1},
    currentType:'sales',
}))
export {state,goodsState};